<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title> - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="__admin_path__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__admin_path__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__admin_path__/css/animate.css" rel="stylesheet">
    <link href="__admin_path__/css/style.css" rel="stylesheet">
    <link href="__admin_path__/css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-12">
                <form method="post" action="">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到H+后台主题UI框架</p>
                    <input type="text" name="username" id="username" class="form-control uname" placeholder="用户名" />
                    <input type="password" name="password" id="password" class="form-control pword m-b" placeholder="密码" />
                    <!-- <a href="">忘记密码了？</a> -->
                    <button class="btn btn-success btn-block btn-login" type="button">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; xiaohu
            </div>
        </div>
    </div>
</body>
	<script src="__admin_path__/js/jquery.min.js"></script>
	<script src="__admin_path__/js/plugins/layer/layer.min.js"></script>
	<script>
		$(".btn-login").click(function(){
			var  username = $("#username").val();
			var  password = $("#password").val();
			if($.trim(username) == ''){
				layer.msg('请输入您的用户名~');
				return false;
			}
			if($.trim(password) == ''){
				layer.msg('请输入您的密码~');
				return false;
			}
			layer.load();
			$.ajax({
	            url:"{:url('account/login')}",
	            type:'post',
	            dataType:'json',
	            data:{username:username,password:password},
	            success:function(res){
	            	layer.closeAll('loading');
	                if(res.code == 1){
	                    layer.msg(res.msg);
	                    window.location.href = res.url;
	                }else{
	                    layer.msg(res.msg);
	                }
	            },
	            error:function(){
	            	layer.closeAll('loading');
	                layer.msg('链接服务器出错,请联系管理员处理');
	            }
	        });
		})
	</script>

</html>
